all: main 

main: main.o lib
	gcc -o main -L. -lfun main.o
	#-L: link .so path -l libxxx.so xxx name
	#this example is libfun.so  fun.

main.o:
	gcc -c main.c -I lib

fun.o:
	gcc -c fun.c -I lib

lib: fun.o
	gcc -fpic -shared -o libfun.so fun.o

clean:
	rm -rf *.o
	rm -rf *.so
